Closed Bug 1340083 Opened 8 years ago Closed 8 years ago

[clang-format] Space should separate braces in empty code

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: jya, Assigned: andi)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Per coding style rules: https://developer.mozilla.org/fr/docs/Developer_Guide/Coding_Style#Classes // Tiny constructors and destructors can be written on a single line. MyClass() { } And not: // Tiny constructors and destructors can be written on a single line. MyClass() {} There should be a space for empty bodied code
Assignee: nobody → bpostelnicu
I'm looking over this issue but i think this could be simplified a bit. 1. Destructor For empty body destructors i think the best approach would be to use the default directive 2. Constructor For empty constructors that don't have neither initialisation list nor body we should also adopt the default directive. For constructor that only have initialiser list we should use the default brace placement.
Attachment #8845827 - Attachment is obsolete: true
Attachment #8845827 - Flags: review?(jwwang)
Attachment #8845827 - Attachment is obsolete: false
Attachment #8845827 - Attachment is obsolete: true
See Also: → 1399359
See Also: → 1399087
Attached patch patch.diffSplinter Review
I've created this patch against clang repo in order to have support for space in empty functions that are not split on two lines. I've tried it on some files and it produces the desired behaviour. When you have time please try it and tell me if you think it's OK.
Attachment #8909327 - Flags: feedback?(jyavenard)
Comment on attachment 8909327 [details] [diff] [review] patch.diff I've cancelled the feedback request since I will directly submit this to upstream and I don't want to burden you with the build of clang-tidy.
Attachment #8909327 - Flags: feedback?(jyavenard) → feedback-
(In reply to Andi-Bogdan Postelnicu [:andi] from comment #4) > Comment on attachment 8909327 [details] [diff] [review] > patch.diff > > I've cancelled the feedback request since I will directly submit this to > upstream and I don't want to burden you with the build of clang-tidy. Minor correct, clang-format not clang-tidy.
Has been submitted upstream: https://reviews.llvm.org/D37979
Attachment #8909327 - Flags: feedback-
As per the resolution from https://reviews.llvm.org/D37979, the patch has not been accepted so we must change our coding style i guess.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: